package cheme.ProcessModel.Interpreter;

import cheme.ProcessModel.IModelElement;
import cheme.ProcessModel.Annotations.IAnnotation;

public class ModelElementData
{
	IModelElement model = null;
//	Node parseNode = null;
	IAnnotation errorAnnotation = null;
	
	public ModelElementData(IModelElement model)
	{
		setModel(model);
	}

	public IModelElement getModel()
	{
		return model;
	}

	public void setModel(IModelElement model)
	{
		this.model = model;
	}

//	public Node getParseNode()
//	{
//		return parseNode;
//	}

//	public void setParseNode(Node parseNode)
//	{
//		if(parseNode instanceof IAstVariable)
//		{
//			getSymbolTable().remove(parseNode.toString()); //out with the old
//			getSymbolTable().add((IAstVariable)parseNode); //in with the new
//		}
//					
//		this.parseNode = parseNode;
//	}

	public IAnnotation getErrorAnnotation()
	{
		return errorAnnotation;
	}

	public void setErrorAnnotation(IAnnotation errorAnnotation)
	{
		if(null != this.errorAnnotation)
		{
			model.removeAnnotation(this.errorAnnotation);
		}
		
		this.errorAnnotation = errorAnnotation;
		
		if(null != this.errorAnnotation)
		{
			model.addAnnotation(this.errorAnnotation);
		}
	}
	
	public void setBackgroundColor()
	{
		//this.getModel();
	}
}
